package com.ang.jdk8.stream;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 详细：DemoTest
 */
public class GroupTest {
    public static void main(String[] args) {
        GroupTest t =  new GroupTest();

        t.test1();
    }

    public void test1(){
        List<String> list = Arrays.asList("a", "b", "c", "d");

        Map<String, List<String>> collect = list.stream().collect(Collectors.groupingBy(String::valueOf));

        System.out.println(collect);

        System.out.println(collect.keySet().size());
    }
}
